<!-- questions-edit.html -->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:include="inc/examHeader::header">
</head>
<script type="text/javascript" src="/exam/js/questions-edit.js" ></script>
<script type="text/javascript" src="/ietm/js/chaptersAdd.js"></script>
<script type="text/javascript" src="/exam/js/chapters.js"></script>
	<body>
		<!--返回-->
		
		<div th:include="header :: header"></div>
		<div id="question-show" >
			<div class="back" onclick="location='/questions/questions'"><img src="../images/back.png" /></div>
			<div class="header-title">
				<span>编辑试题</span>
			</div>
			<div class="spare-a">
			<div class="save-bg"><a href="#" id="questions-edit" class="spare-tj">发 布</a></div>
			<div class="questions-add">
				<div class="questionsa-add clearfix">
					<ul>
						<li  th:if="${question.code} eq '单选题'"><a class="active"  onclick="setQuestionType('chosequestion','choseoption')" href="#" style="border-bottom-left-radius:5px;border-top-left-radius:5px">单选题</a></li>
						<li  th:if="${question.code} eq '多选题'"><a class="active" onclick="setQuestionType('checkquestion','checkoption')" href="#">多选题</a></li>
						<li  th:if="${question.code} eq '判断题'"><a class="active" onclick="setQuestionType('judequestion','judgeoption')" href="#">判断题</a></li>
						<li  th:if="${question.code} eq '问答题'"><a class="active" onclick="setQuestionType('askquestion','askoption')" href="#">问答题</a></li>
						<li  th:if="${question.code} eq '填空题'"><a class="active" onclick="setQuestionType('fillquestion','filloption')" href="#" style="border-bottom-right-radius:5px;border-top-right-radius:5px">填空题</a></li>
					</ul>
				</div>
				<div class="questionsb-add" style="display:block" th:if="${question.code} eq '单选题'"  id="chose">
					<form action="#" th:action="@{/questions/updateQuestion}" id="chosequestion" method="post">
					<input name="code" th:value="${question.code}" type="hidden"/>
					<input type="hidden" name="id" th:value="${question.id}"/>
					<div class="questionsba-add">
						<ul>
						  <li>
							<div class="spare-addl"><span class="star">*</span>内容：</div>
							<div class="spare-addr"><textarea class="spare-add-textarea" th:text="${question.content}" name="content" id="content-only"></textarea></div>
						  </li>
						  <li>
							<div class="spare-addl"><span class="star">*</span>答案选项：</div>
							<div class="spare-addr" id="choseoption">
								<div class="spare-addr-new">
									<a href="#" onclick="showOption('chosequestion','choseoption')" class="spare-tj">新 增</a>
									<a href="#" onclick="delOption('choseoption')" class="spare-del">删 除</a>
								</div>
								<div th:class="${#strings.contains(question.answer,'A')}? 'questionsba-list clearfix active' : 'questionsba-list clearfix'" th:if="${question.A} ne null">
									<div class="questionsba-listl">A</div>
									<div class="questionsba-listr"><input type="text" class="list-input" name="A"  th:value="${question.A}"/></div>
									<div class="documentation-check"></div>
								</div>
								<div th:class="${#strings.contains(question.answer,'B')}? 'questionsba-list clearfix active' : 'questionsba-list clearfix'" th:if="${question.B} ne null">
									<div class="questionsba-listl">B</div>
									<div class="questionsba-listr"><input type="text" class="list-input" name="B"  th:value="${question.B}"/></div>
									<div class="documentation-check"></div>
								</div>
								<div th:class="${#strings.contains(question.answer,'C')}? 'questionsba-list clearfix active' : 'questionsba-list clearfix'" th:if="${question.C} ne null">
									<div class="questionsba-listl">C</div>
									<div class="questionsba-listr"><input type="text" class="list-input" name="C"  th:value="${question.C}"/></div>
									<div class="documentation-check"></div>
								</div>
								<div th:class="${#strings.contains(question.answer,'D')}? 'questionsba-list clearfix active' : 'questionsba-list clearfix'" th:if="${question.D} ne null">
									<div class="questionsba-listl">D</div>
									<div class="questionsba-listr"><input type="text" class="list-input" name="D" th:value="${question.D}"/></div>
									<div class="documentation-check"></div>
								</div>
								<div th:class="${#strings.contains(question.answer,'E')}? 'questionsba-list clearfix active' : 'questionsba-list clearfix'" th:if="${question.E} ne null">
									<div class="questionsba-listl">E</div>
									<div class="questionsba-listr"><input type="text" class="list-input" name="E" th:value="${question.E}"/></div>
									<div class="documentation-check"></div>
								</div>
							</div>
						  </li>
						  <li>
							<div class="spare-addl">答案解析说明：</div>
							<div class="spare-addr"><textarea class="spare-add-textarea" th:text="${question.explain}" name="explain" id="exp-only"></textarea></div>
						  </li>
						  <li>
							<div class="spare-addl">答案关联章节：</div>
							<div class="spare-addr" id="choseChapters">
								<div class="spare-addr-new">
									<a href="#" onclick="showChapters('chosequestion','choseChapters')" class="spare-tj">新 增</a>
									<a href="#" onclick="delChapters('choseChapters')" class="spare-del">删 除</a>
								</div>
								<div class="questionsba-lista clearfix" th:each="d:${dms}">
									<input type="hidden" name="dataModelhidden" th:value="${d.id}"/>
									<div class="questionsbb-listl" th:text="${'数据模块代码:'+d.dmCode}"></div>
									<div class="questionsbb-listl" th:text="${'标题:'+d.dmTitle}"></div>
									<div class="documentation-check"></div>
								</div>
							</div>
						  </li>
						</ul>
					</div>
					</form>
				</div>
				<div class="questionsb-add" style="display:block" th:if="${question.code} eq '多选题'" id="check">
				    <form action="#" th:action="@{/questions/updateQuestion}" id="checkquestion" method="post">
					<input name="code" th:value="${question.code}" type="hidden"/>
					<input type="hidden" name="id" th:value="${question.id}"/>
					<div class="questionsba-add">
						<ul>
						  <li>
							<div class="spare-addl"><span class="star">*</span>内容：</div>
							<div class="spare-addr"><textarea class="spare-add-textarea" th:text="${question.content}" name="content" id="content-more"></textarea></div>
						  </li>
						  <li>
							<div class="spare-addl"><span class="star">*</span>答案选项：</div>
							<div class="spare-addr" id="checkoption">
								<div class="spare-addr-new">
									<a href="#" onclick="showOption('checkquestion','checkoption')" class="spare-tj">新 增</a>
									<a href="#" onclick="delOption('checkoption')" class="spare-del">删 除</a>
								</div>
								 <div  th:class="${#strings.contains(question.answer,'A')}? 'questionsba-lista clearfix active' : 'questionsba-lista clearfix'" th:if="${question.A} ne null">
									<div class="questionsba-listl">A</div>
									<div class="questionsba-listr"><input type="text" class="list-input" name="A" th:value="${question.A}" /></div>
									<div class="documentation-check"></div>
								</div>
								<div th:class="${#strings.contains(question.answer,'B')}? 'questionsba-lista clearfix active' : 'questionsba-lista clearfix'" th:if="${question.B} ne null">
									<div class="questionsba-listl">B</div>
									<div class="questionsba-listr"><input type="text" class="list-input" name="B" th:value="${question.B}"/></div>
									<div class="documentation-check"></div>
								</div>
								<div th:class="${#strings.contains(question.answer,'C')}? 'questionsba-lista clearfix active' : 'questionsba-lista clearfix'" th:if="${question.C} ne null">
									<div class="questionsba-listl">C</div>
									<div class="questionsba-listr"><input type="text" class="list-input" name="C" th:value="${question.C}"/></div>
									<div class="documentation-check"></div>
								</div>
								<div th:class="${#strings.contains(question.answer,'D')}? 'questionsba-lista clearfix active' : 'questionsba-lista clearfix'" th:if="${question.D} ne null">
									<div class="questionsba-listl">D</div>
									<div class="questionsba-listr"><input type="text" class="list-input" name="D" th:value="${question.D}"/></div>
									<div class="documentation-check"></div>
								</div>
								<div th:class="${#strings.contains(question.answer,'E')}? 'questionsba-lista clearfix active' : 'questionsba-lista clearfix'" th:if="${question.E} ne null">
									<div class="questionsba-listl">E</div>
									<div class="questionsba-listr"><input type="text" class="list-input" name="E" th:value="${question.E}"/></div>
									<div class="documentation-check"></div>
								</div>
							</div>
						  </li>
						  <li>
							<div class="spare-addl">答案解析说明：</div>
							<div class="spare-addr"><textarea class="spare-add-textarea" th:text="${question.explain}" name="explain"  id="exp-more"></textarea></div>
						  </li>
						  <li>
							<div class="spare-addl">答案关联章节：</div>
							<div class="spare-addr" id="checkChapters">
								<div class="spare-addr-new">
									<a href="#" onclick="showChapters('checkquestion','checkChapters')" class="spare-tj">新 增</a>
									<a href="#" onclick="delChapters('checkChapters')" class="spare-del">删 除</a>
								</div>
								<div class="questionsba-lista clearfix" th:each="d:${dms}">
									<input type="hidden" name="dataModelhidden" th:value="${d.id}"/>
									<div class="questionsbb-listl" th:text="${'数据模块代码:'+d.dmCode}"></div>
									<div class="questionsbb-listl" th:text="${'标题:'+d.dmTitle}"></div>
									<div class="documentation-check"></div>
								</div>
							</div>
						  </li>
						</ul>
					</div>
				</form>
				</div>
				<div class="questionsb-add" style="display:block" th:if="${question.code} eq '判断题'" id="jude">
				   <form action="#" th:action="@{/questions/updateQuestion}" id="judequestion" method="post">
					<input name="code" th:value="${question.code}" type="hidden"/>
					<input type="hidden" name="id" th:value="${question.id}"/>
					<div class="questionsba-add">
						<ul>
						  <li>
							<div class="spare-addl"><span class="star">*</span>内容：</div>
							<div class="spare-addr"><textarea class="spare-add-textarea" th:text="${question.content}" name="content" id="content-judge"></textarea></div>
						  </li>
						  <li>
							<div class="spare-addl"><span class="star">*</span>答案选项：</div>
							<div class="spare-addr" id="judgeoption">
								<div th:class="${#strings.contains(question.answer,'A')}? 'questionsba-list clearfix active' : 'questionsba-list clearfix'" th:if="${question.A} ne null">
									<div class="questionsba-listl">A</div>
									<div class="questionsba-listr"><input type="text" name="A"  class="list-input" readonly="readonly"  value="正确" /></div>
									<div class="documentation-check"></div>
								</div>
								<div th:class="${#strings.contains(question.answer,'B')}? 'questionsba-list clearfix active' : 'questionsba-list clearfix'" th:if="${question.B} ne null">
									<div class="questionsba-listl">B</div>
									<div class="questionsba-listr"><input type="text" name="B"  class="list-input" readonly="readonly" value="错误" /></div>
									<div class="documentation-check"></div>
								</div>
							</div>
						  </li>
						  <li>
							<div class="spare-addl">答案解析说明：</div>
							<div class="spare-addr"><textarea class="spare-add-textarea" name="explain" th:text="${question.explain}"></textarea></div>
						  </li>
						  <li>
							<div class="spare-addl">答案关联章节：</div>
							<div class="spare-addr" id="judgeChapters">
								<div class="spare-addr-new" >
									<a href="#" onclick="showChapters('judequestion','judgeChapters')" class="spare-tj">新 增</a>
									<a href="#" onclick="delChapters('judgeChapters')"  class="spare-del">删 除</a>
								</div>
								<div class="questionsba-lista clearfix" th:each="d:${dms}">
									<input type="hidden" name="dataModelhidden" th:value="${d.id}"/>
									<div class="questionsbb-listl" th:text="${'数据模块代码:'+d.dmCode}"></div>
									<div class="questionsbb-listl" th:text="${'标题:'+d.dmTitle}"></div>
									<div class="documentation-check"></div>
								</div>
							</div>
						  </li>
						</ul>
					</div>
					</form>
				</div>
				<div class="questionsb-add" style="display:block" th:if="${question.code} eq '问答题'" id="ask">
				   <form action="#" th:action="@{/questions/updateQuestion}" id="askquestion" method="post">
					<input name="code" th:value="${question.code}" type="hidden"/>
					<input type="hidden" name="id" th:value="${question.id}"/>
					<div class="questionsba-add">
						<ul>
						  <li>
							<div class="spare-addl"><span class="star">*</span>内容：</div>
							<div class="spare-addr"><textarea class="spare-add-textarea" th:text="${question.content}"  name="content" id="content-qa"></textarea></div>
						  </li>
						  <li>
							<div class="spare-addl"><span class="star">*</span>参考答案：</div>
							<div class="spare-addr"><textarea class="spare-add-textarea" th:text="${question.answer}" name="answer" id="answer-qa"></textarea></div>
						  </li>
						  <li>
							<div class="spare-addl">答案解析说明：</div>
							<div class="spare-addr"><textarea class="spare-add-textarea" th:text="${question.explain}" name="explain" id="exp-qa"></textarea></div>
						  </li>
						  <li>
							<div class="spare-addl">答案关联章节：</div>
							<div class="spare-addr" id="askChapters">
								<div class="spare-addr-new">
									<a href="#" onclick="showChapters('askquestion','askChapters')" class="spare-tj">新 增</a>
									<a href="#" onclick="delChapters('askChapters')" class="spare-del">删 除</a>
								</div>
								<div class="questionsba-lista clearfix" th:each="d:${dms}">
									<input type="hidden" name="dataModelhidden" th:value="${d.id}"/>
									<div class="questionsbb-listl" th:text="${'数据模块代码:'+d.dmCode}"></div>
									<div class="questionsbb-listl" th:text="${'标题:'+d.dmTitle}"></div>
									<div class="documentation-check"></div>
								</div>
							</div>
						  </li>
						</ul>
					</div>
					</form>
				</div>
				<div class="questionsb-add" style="display:block" th:if="${question.code} eq '填空题'" id="fill">
				   <form action="#" th:action="@{/questions/updateQuestion}" id="fillquestion" method="post">
					<input name="code" th:value="${question.code}" type="hidden"/>
					<input type="hidden" name="id" th:value="${question.id}"/>
					<div class="questionsba-add">
						<ul>
						  <li>
							<div class="spare-addl"><span class="star">*</span>内容：</div>
							<div class="spare-addr"><textarea class="spare-add-textarea" th:text="${question.content}"  name="content" id="content-qf"></textarea></div>
						  </li>
						  <li>
							<div class="spare-addl"><span class="star">*</span>参考答案：</div>
							<div class="spare-addr"><textarea class="spare-add-textarea" th:text="${question.answer}" name="answer" id="answer-qf"></textarea></div>
						  </li>
						  <li>
							<div class="spare-addl">答案解析说明：</div>
							<div class="spare-addr"><textarea class="spare-add-textarea" th:text="${question.explain}" name="explain" id="exp-qf"></textarea></div>
						  </li>
						  <li>
							<div class="spare-addl">答案关联章节：</div>
							<div class="spare-addr" id="fillChapters">
								<div class="spare-addr-new">
									<a href="#" onclick="showChapters('fillquestion','fillChapters')" class="spare-tj">新 增</a>
									<a href="#" onclick="delChapters('fillChapters')" class="spare-del">删 除</a>
								</div>
								<div class="questionsba-lista clearfix" th:each="d:${dms}">
									<input type="hidden" name="dataModelhidden" th:value="${d.id}"/>
									<div class="questionsbb-listl" th:text="${'数据模块代码:'+d.dmCode}"></div>
									<div class="questionsbb-listl" th:text="${'标题:'+d.dmTitle}"></div>
									<div class="documentation-check"></div>
								</div>
							</div>
						  </li>
						</ul>
					</div>
					</form>
				</div>
			</div>
		</div>
		</div>
		<!-- 新增答案选项 -->
		<div id="option-hide">
		    <div class="back" onclick="hideOption()"><img src="../images/back.png" /></div>
			 <div class="header-title">
				<span>新增答案选项</span>
			</div>
			<div class="spare-a">
				<div class="save-bg">
				<a href="#" onclick="addoption()" class="spare-tj">保 存</a>
				</div>
				<div class="spare-add">
					<ul>
						<li>
							<div class="spare-addl">选项：</div>
							<div class="spare-addr"><input type="text" id="option" class="spare-add-input" /></div>
						</li>
						<li>
							<div class="spare-addl">内容：</div>
							<div class="spare-addr"><input type="text" id="optionContent" class="spare-add-input" /></div>
						</li>
					</ul>
				</div>
			</div>
		</div>
		<div id="chapters-add" style="display:none">
			<!--返回-->
				<div class="back" onclick="hideOption()"><img src="../images/back.png" /></div>
				<div class="header-title">
					<span>新增答案关联章节</span>
				</div>
				<div class="spare-a">
					<div class="spare-al">
						<div style="height:10px"></div>
						<ul>
							<li th:each="prow,iterStat:${pmrows}" th:id="${prow.id}" th:text="${prow.title}" th:onclick="'clickFirstPm(\''+${prow.id}+'\');'"> </li>
						</ul>
					</div>
					<div class="spare-ar">
						<div class="spare-ara">
							<div class="chapters clearfix">
								<ul id="secPmList">
								</ul>
							</div>
							<div class="spare-ara-a clearfix">
								<div class="spare-ara-al">
									<div class="spare-ara-all"><input type="text" placeholder="请输入DM相关信息" id="search"/></div>
									<div class="spare-ara-alr"></div>
								</div>
								<div class="spare-ara-ar"><a href="#" onclick="addChapters()" class="spare-tj">确 定</a></div>
							</div>
							<div class="chapter-a">
								<div class="chapter-a-title">DM列表</div>
								<div class="srcoll-documentation" id="srcoll-documentation">
								<div class="chapter-b" id="allDmList">
								</div>	
								</div>
							</div>
							
						</div>
					</div>
				</div>
		
		</div>
	</body>
</html>
